package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * sky-take-out
 * com.sky.mapper <br>
 * 菜品口味Mapper
 * @author Ablecisi
 * @version 1.0
 * 2025/3/1
 * 星期六
 * 00:40
 */
@Mapper
public interface DishFlavorMapper {

    /**
     * 添加菜品口味
     * @param flavors 口味列表
     */
    void addFlavors(List<DishFlavor> flavors);

    /**
     * 删除口味
     * @param dishIds 菜品IDs
     */
    void deleteByDishIds(List<Long> dishIds);

    /**
     * 查询口味根据菜品ID
     * @param id 菜品ID
     * @return 口味列表
     */
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> selectFlavorByDishId(Long id);

}
